package bookSystem;

import java.util.Scanner;

public class Person {
        private String name;

        public Person(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Person() {
        }

        public Book buyBook(Book[] book) {
            Book book1 = null;
            System.out.println("输入要购买的图书编号");
            Scanner sc = new Scanner(System.in);
            int id = sc.nextInt();
            for (int i = 0; i < book.length; i++) {
                if (book[i].getId() == id) {
                    book1 = book[i];
                    break;
                }
            }
            return book1;
        }



}
